package com.crm.controller;

import com.crm.entity.Clue;
import com.crm.page.CluePage;
import com.crm.service.ClueService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 线索管理相关接口
 */
@RestController
public class ClueController {
    @Autowired
    ClueService clueService;

    /**
     * 新建线索
     * @param clue
     */
    @PostMapping("/clues/clue")
    public void insertClue(@RequestBody Clue clue){
        clueService.insertClue(clue);
//        System.out.println(clue);
    }
    /**
     * 分页查询线索列表
     */
    @GetMapping("/clues/clue/list")
    public PageInfo<Clue> getClueList(@ModelAttribute CluePage cluePage) {
        return clueService.getClueListByPage(cluePage);
    }
    /**
     * 根据id查询回显
     */
    //clues/record/list?clueId=9183
    @GetMapping("/clues/record/list")
    public Clue getClueById(@RequestParam("clueId") Long clueId) {
//        return clueService.getClueById(clueId);
        return null;
    }



}
